package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(DemoApplication.class, args);
        JdbcTemplate template = context.getBean(JdbcTemplate.class);
        template.execute(
                "create table if not exists code (\n" +
                        "       id    INTEGER PRIMARY KEY  AUTOINCREMENT NOT NULL ,\n" +
                        "       time  TEXT    NOT NULL,\n" +
                        "       code  TEXT    NOT NULL);");
        String port = context.getEnvironment().getProperty("server.port");
        System.out.println("项目启动成功\n" +
                "　∧＿_∧　 ∧_＿∧\n" +
                "(( ・∀・))・∀・))\n" +
                "`＼　　 ∧ 　　ノ\n" +
                "　/　　｜/　　｜\n" +
                "（＿ノ＿)_ノL＿)" +
                "http://localhost:" + port);
    }

}
